<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>

<%
	
    Connection con;
    Statement sql; 
    ResultSet rs;
    try{ Class.forName("com.mysql.jdbc.Driver");}
    catch(Exception e){   	
    }
    
       String uri= "jdbc:mysql://127.0.0.1/sign";
        String user="root";
        String password="";
        con=DriverManager.getConnection(uri,user,password);
       
  
	 sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
	                        ResultSet.CONCUR_READ_ONLY);
     String na=request.getParameter("name");
     String nu=request.getParameter("number");
     String co=request.getParameter("course");
     String bbname=(String)session.getAttribute("name");
     
         	String condition = "INSERT INTO "+"sign"+" VALUES"+
			      "("+"'"+bbname+"','"+nu+"','"+co+"')";
       	 sql.executeUpdate(condition);
       	 rs=sql.executeQuery("SELECT * FROM "+"sign");
    	 ResultSetMetaData metaData = rs.getMetaData();
    	 int columnCount = metaData.getColumnCount(); 
    	 rs.beforeFirst();
         int i=0;
         
         
         
         
         while(rs.next()){
           
           for(int k=0;k<columnCount;k++) 
           {
        	   out.print(rs.getString(k+1)+"&nbsp;&nbsp;&nbsp;");
        	   
           }
           out.print("<br>");
           i++; 
         }
    	 con.close();
	 

	
%>